home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / fractal / kaos.lha / bin / kedgr < prev    next >
Encoding:
Text File  |  1990-01-30  |  381 b   |  23 lines

  1. #!/bin/csh
  2. #
  3. # kedgr - recursive global string substitution on the subdirectories
  4. # syntax: kedgr string1 string2 filenames
  5. #
  6. set allfiles = `ls`
  7. set subfiles = `ls $argv[3-]`
  8. set file =
  9. foreach file ($subfiles)
  10.     if( -f $file) then
  11. ed $file <<!
  12. 1,\$s/$1/$2/g
  13. w
  14. !
  15.     endif
  16. end
  17.  
  18. foreach file ($allfiles)
  19.     if( -d $file) then
  20.         echo cd $file; cd $file; kedgr $argv[1-]; cd ..
  21.     endif
  22. end
  23.